<template>
  <div>
      <h1>汽车管理</h1>
      <img src="/project/html/begin.jpg" width="200" height="200"/>
      <CarList :cutBean="cutBean" @find="findByItem" @setCar="setUpdateCar"></CarList>
      <CarAdd @find="findByItem"></CarAdd>
      <CarUpdate :updateCar="updateCar" @find="findByItem"></CarUpdate>
  </div>
</template>

<script>
import CarList from "./carPage/CarList.vue"
import CarAdd from "./carPage/CarAdd.vue"
import CarUpdate from  "./carPage/CarUpdate.vue"


export default {
    components:{CarList,CarAdd,CarUpdate},
    data(){
        return {
            cutBean:{},
            updateCar:{}
        }
    },
    methods:{
        async findByItem(param){
            var cutObj = await this.ajax.getSubmit("/project/car/findByItem",param);
            this.cutBean = cutObj;
        },
        setUpdateCar(car){
            this.updateCar = car;
        }
    },
    created(){
        this.findByItem({pageNO:1});
    }

}
</script>

<style>

</style>
